<template>
  <div id="app" >
    <router-view/>
  </div>
</template>
<script>
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串  
var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器  
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
var isIE11 = userAgent.indexOf("rv:11.0") > -1; //判断是否是IE11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
if(!isIE && !isEdge && !isIE11) {//兼容chrome和firefox  
	var _beforeUnload_time = 0, _gap_time = 0;
	var is_fireFox = navigator.userAgent.indexOf("Firefox")>-1;//是否是火狐浏览器
	window.onunload = function (){
    debugger
		_gap_time = new Date().getTime() - _beforeUnload_time;
		if(_gap_time <= 5){
		//执行浏览器关闭你所要做的事情比如登出
    }else{//浏览器刷新
    
		}
 	}
	window.onbeforeunload = function (){ 
		_beforeUnload_time = new Date().getTime();
		if(is_fireFox){//火狐关闭执行
     //执行浏览器关闭你所要做的事情比如登出

		} 
	};
}
export default {
  
}
</script>

<style lang="scss">
@import "styles/main";
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}


</style>
